import Color from 'color'

export function genThemeTypeLevelColor (type, color) {
    const _color = new Color(color)
    const lightMap = [3, 5, 7, 8, 9].reduce((prev, current) => {
        const result = _color.mix(new Color('#fff'), current / 10).hex()
        prev[`--el-color-${type}-light-${current}`] = result
        return prev
    }, {})
    const darkMap = [2].reduce((prev, current) => {
        const result = _color.mix(new Color('#000'), current / 10).hex()
        prev[`--el-color-${type}-dark-${current}`] = result
        return prev
    }, {})
    return {
        [`--el-color-${type}`]: _color.hex(),
        ...lightMap,
        ...darkMap
    }
}